package com.zmj.service;

import com.zmj.entity.Article;
import com.zmj.mapper.ArticleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    public Article create(Article article){
        boolean res = articleMapper.create(article)>0;
        if (res){
            return article;
        }else {
            return null;
        }
    }

    public List<Article> getArticle(){
      List<Article> list =   articleMapper.getArticle();
      if (list != null){
          return list;
      }else {
          return null;
      }
    }


}
